function pagination2(current,total,params,px,pg ){//绘制最多6个标记
        var HTML=""; 
        var separator=''; 
        if(total<=6){
                if(total==1)return '<a href="javascript:;" >&#171;上一页</a><span class="page-cur"  href="javascript:;">1</span><a href="javascript:;">下一页&#187;</a>';
                //生成上一页按钮
                if(current==1){
                    HTML+='<a href="javascript:;" >&#171;上一页</a>';
                }else{
                    HTML+='<a href=\"'+params+(current-1)+px+'\">&#171;上一页</a>';
                }
                //生成中间按钮
                HTML+=getMidHTML(1,total,current ,params,px);
                //生成下一页按钮
                if(current==total){
                    HTML+='<a href="javascript:;">下一页&#187;</a>';
                }else{
                    HTML+='<a href=\"'+params+(current+1)+px+'\">下一页&#187;</a>';
                }
        }else if(current-1<=2){
                HTML=getPreHTML(current,total,params,px);
                HTML+=getMidHTML(2,4,current,params,px);
                HTML+=separator;
                HTML+=getLastHTML(current,total,params,px);
         }else if(total-current<=2){
             HTML=getPreHTML(current,total,params,px);
             HTML+=separator;
             HTML+=getMidHTML(total-2,total-1,current,params,px);
             HTML+=getLastHTML(current,total,params,px);
         }else {
             HTML=getPreHTML(current,total,params,px);
             HTML+=separator;
             HTML+=getMidHTML(current-1,current+1,current ,params,px);
             HTML+=separator;
             HTML+=getLastHTML(current,total,params,px);
         }
         if(pg==1){
			HTML+='<input type="text" value="'+current+'" size="3" maxlength="3" id="pageNum1" style="width:22px; margin:0 5px; vertical-align:middle;"/>';         	
         }else{
         	HTML+='<input type="text" value="'+current+'" size="3" maxlength="3" id="pageNum2" style="width:22px; margin:0 5px; vertical-align:middle;"/>';
         }
         
         HTML+="<img src='images/searchList_19.jpg' onmousedown=turnPage("+total+",'"+params+"','"+px+"','"+pg+"') style=\"vertical-align:middle;\" />";
        return HTML;
    }
    function getPreHTML (current,total,params,px){//生成前三个按钮，1,2和上一页按钮
        var html="";
        if(current==1){
                    html+='<a href="javascript:;">&#171;上一页</a>';
                    html+='<span href=\"'+params+1+px+'\"  class="page-cur">'+1+'</span>';
            }else{
                    html+='<a href=\"'+params+(current-1)+px+'\">&#171;上一页</a>';
                    html+='<a href=\"'+params+1+px+'\" >1</a>';
            }
            return html;
        }
       function  getMidHTML  (first,last,current,params,px){
            var html="";
            for(var i=first;i<=last;i++){
                if(i==current){
                        html+='<span class="page-cur"  href="javascript:;">'+current+'</span>';
                }else{
                        html+='<a href=\"'+params+i+px+'\">'+i+'</a>';
                }
            }
            return html;
        }
      function  getLastHTML (current,total,params,px){
            //生成三个按钮，最后两页和下一页按钮
            var html="";//不可不初始化,否则在字符串相加时出现undefined
                if(current==total){//生成最后二个按钮
                        html+='<span href="javascript:;" class="page-cur">'+total+ '</span>';
                        html+='<a href="javascript:;">下一页&#187;</a>';
                }else{
                    //html+='<a href=\"'+params+total+px+'\">'+total+'</a>';
                    html+='<a href=\"'+params+(current+1)+px+'\">下一页&#187;</a>';
                }
            return html;
        }
        //跳转到第几页
         function turnPage(total,params,px,pg){
            var page =$.trim(document.getElementById("pageNum"+pg).value);
            if(page==""){
            	return;
            }
            if(page==0){
            	return;
            }
            if(!isNumber(page)){
            	return;
            }
            if(page>total){
            	page=total;
            }
          window.location.href=params+page+px+'';
        }        
    function isNumber(str)
{
    var objReg = /^\d+$/;
    if (objReg.test(str))
        return true;
 	else
        return false;
}
